// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers.  See the top-level LICENSE file for dates and other
// details.  No copyright assignment is required to contribute to VisIt.

#include <PyRadialResampleAttributes.h>
#include <ObserverToCallback.h>
#include <stdio.h>
#include <Py2and3Support.h>

// ****************************************************************************
// Module: PyRadialResampleAttributes
//
// Purpose:
//
// Note:       Autogenerated by xml2python. Do not modify by hand!
//
// Programmer: xml2python
// Creation:   omitted
//
// ****************************************************************************

//
// This struct contains the Python type information and a RadialResampleAttributes.
//
struct RadialResampleAttributesObject
{
    PyObject_HEAD
    RadialResampleAttributes *data;
    bool        owns;
    PyObject   *parent;
};

//
// Internal prototypes
//
static PyObject *NewRadialResampleAttributes(int);
std::string
PyRadialResampleAttributes_ToString(const RadialResampleAttributes *atts, const char *prefix, const bool forLogging)
{
    std::string str;
    char tmpStr[1000];

    if(atts->GetIsFast())
        snprintf(tmpStr, 1000, "%sisFast = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sisFast = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sminTheta = %g\n", prefix, atts->GetMinTheta());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%smaxTheta = %g\n", prefix, atts->GetMaxTheta());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sdeltaTheta = %g\n", prefix, atts->GetDeltaTheta());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sradius = %g\n", prefix, atts->GetRadius());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sdeltaRadius = %g\n", prefix, atts->GetDeltaRadius());
    str += tmpStr;
    {   const float *center = atts->GetCenter();
        snprintf(tmpStr, 1000, "%scenter = (", prefix);
        str += tmpStr;
        for(int i = 0; i < 3; ++i)
        {
            snprintf(tmpStr, 1000, "%g", center[i]);
            str += tmpStr;
            if(i < 2)
            {
                snprintf(tmpStr, 1000, ", ");
                str += tmpStr;
            }
        }
        snprintf(tmpStr, 1000, ")\n");
        str += tmpStr;
    }
    if(atts->GetIs3D())
        snprintf(tmpStr, 1000, "%sis3D = 1\n", prefix);
    else
        snprintf(tmpStr, 1000, "%sis3D = 0\n", prefix);
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sminAzimuth = %g\n", prefix, atts->GetMinAzimuth());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%smaxAzimuth = %g\n", prefix, atts->GetMaxAzimuth());
    str += tmpStr;
    snprintf(tmpStr, 1000, "%sdeltaAzimuth = %g\n", prefix, atts->GetDeltaAzimuth());
    str += tmpStr;
    return str;
}

static PyObject *
RadialResampleAttributes_Notify(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    obj->data->Notify();
    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_SetIsFast(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the isFast in the object.
    obj->data->SetIsFast(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetIsFast(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetIsFast()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetMinTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the minTheta in the object.
    obj->data->SetMinTheta(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetMinTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetMinTheta()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetMaxTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the maxTheta in the object.
    obj->data->SetMaxTheta(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetMaxTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetMaxTheta()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetDeltaTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the deltaTheta in the object.
    obj->data->SetDeltaTheta(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetDeltaTheta(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetDeltaTheta()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetRadius(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the radius in the object.
    obj->data->SetRadius(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetRadius(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetRadius()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetDeltaRadius(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the deltaRadius in the object.
    obj->data->SetDeltaRadius(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetDeltaRadius(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetDeltaRadius()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetCenter(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;
    float *vals = obj->data->GetCenter();

    if (!PySequence_Check(args) || PyUnicode_Check(args))
        return PyErr_Format(PyExc_TypeError, "Expecting a sequence of numeric args");

    // break open args seq. if we think it matches this API's needs
    if (PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PySequence_Check(packaged_args) && !PyUnicode_Check(packaged_args) &&
            PySequence_Size(packaged_args) == 3)
            args = packaged_args;
    }

    if (PySequence_Size(args) != 3)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "Expecting 3 numeric args");
    }

    for (Py_ssize_t i = 0; i < PySequence_Size(args); i++)
    {
        PyObject *item = PySequence_GetItem(args, i);

        if (!PyNumber_Check(item))
        {
            Py_DECREF(item);
            Py_XDECREF(packaged_args);
            return PyErr_Format(PyExc_TypeError, "arg %d is not a number type", (int) i);
        }

        double val = PyFloat_AsDouble(item);
        float cval = float(val);

        if (val == -1 && PyErr_Occurred())
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            PyErr_Clear();
            return PyErr_Format(PyExc_TypeError, "arg %d not interpretable as C++ float", (int) i);
        }
        if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
        {
            Py_XDECREF(packaged_args);
            Py_DECREF(item);
            return PyErr_Format(PyExc_ValueError, "arg %d not interpretable as C++ float", (int) i);
        }
        Py_DECREF(item);

        vals[i] = cval;
    }

    Py_XDECREF(packaged_args);

    // Mark the center in the object as modified.
    obj->data->SelectCenter();

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetCenter(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    // Allocate a tuple the with enough entries to hold the center.
    PyObject *retval = PyTuple_New(3);
    const float *center = obj->data->GetCenter();
    for(int i = 0; i < 3; ++i)
        PyTuple_SET_ITEM(retval, i, PyFloat_FromDouble(double(center[i])));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetIs3D(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    long val = PyLong_AsLong(args);
    bool cval = bool(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ bool");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(long(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ bool");
    }

    Py_XDECREF(packaged_args);

    // Set the is3D in the object.
    obj->data->SetIs3D(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetIs3D(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyInt_FromLong(obj->data->GetIs3D()?1L:0L);
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetMinAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the minAzimuth in the object.
    obj->data->SetMinAzimuth(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetMinAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetMinAzimuth()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetMaxAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the maxAzimuth in the object.
    obj->data->SetMaxAzimuth(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetMaxAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetMaxAzimuth()));
    return retval;
}

/*static*/ PyObject *
RadialResampleAttributes_SetDeltaAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;

    PyObject *packaged_args = 0;

    // Handle args packaged into a tuple of size one
    // if we think the unpackaged args matches our needs
    if (PySequence_Check(args) && PySequence_Size(args) == 1)
    {
        packaged_args = PySequence_GetItem(args, 0);
        if (PyNumber_Check(packaged_args))
            args = packaged_args;
    }

    if (PySequence_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "expecting a single number arg");
    }

    if (!PyNumber_Check(args))
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_TypeError, "arg is not a number type");
    }

    double val = PyFloat_AsDouble(args);
    float cval = float(val);

    if (val == -1 && PyErr_Occurred())
    {
        Py_XDECREF(packaged_args);
        PyErr_Clear();
        return PyErr_Format(PyExc_TypeError, "arg not interpretable as C++ float");
    }
    if (fabs(double(val))>1.5E-7 && fabs((double(double(cval))-double(val))/double(val))>1.5E-7)
    {
        Py_XDECREF(packaged_args);
        return PyErr_Format(PyExc_ValueError, "arg not interpretable as C++ float");
    }

    Py_XDECREF(packaged_args);

    // Set the deltaAzimuth in the object.
    obj->data->SetDeltaAzimuth(cval);

    Py_INCREF(Py_None);
    return Py_None;
}

/*static*/ PyObject *
RadialResampleAttributes_GetDeltaAzimuth(PyObject *self, PyObject *args)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)self;
    PyObject *retval = PyFloat_FromDouble(double(obj->data->GetDeltaAzimuth()));
    return retval;
}



PyMethodDef PyRadialResampleAttributes_methods[RADIALRESAMPLEATTRIBUTES_NMETH] = {
    {"Notify", RadialResampleAttributes_Notify, METH_VARARGS},
    {"SetIsFast", RadialResampleAttributes_SetIsFast, METH_VARARGS},
    {"GetIsFast", RadialResampleAttributes_GetIsFast, METH_VARARGS},
    {"SetMinTheta", RadialResampleAttributes_SetMinTheta, METH_VARARGS},
    {"GetMinTheta", RadialResampleAttributes_GetMinTheta, METH_VARARGS},
    {"SetMaxTheta", RadialResampleAttributes_SetMaxTheta, METH_VARARGS},
    {"GetMaxTheta", RadialResampleAttributes_GetMaxTheta, METH_VARARGS},
    {"SetDeltaTheta", RadialResampleAttributes_SetDeltaTheta, METH_VARARGS},
    {"GetDeltaTheta", RadialResampleAttributes_GetDeltaTheta, METH_VARARGS},
    {"SetRadius", RadialResampleAttributes_SetRadius, METH_VARARGS},
    {"GetRadius", RadialResampleAttributes_GetRadius, METH_VARARGS},
    {"SetDeltaRadius", RadialResampleAttributes_SetDeltaRadius, METH_VARARGS},
    {"GetDeltaRadius", RadialResampleAttributes_GetDeltaRadius, METH_VARARGS},
    {"SetCenter", RadialResampleAttributes_SetCenter, METH_VARARGS},
    {"GetCenter", RadialResampleAttributes_GetCenter, METH_VARARGS},
    {"SetIs3D", RadialResampleAttributes_SetIs3D, METH_VARARGS},
    {"GetIs3D", RadialResampleAttributes_GetIs3D, METH_VARARGS},
    {"SetMinAzimuth", RadialResampleAttributes_SetMinAzimuth, METH_VARARGS},
    {"GetMinAzimuth", RadialResampleAttributes_GetMinAzimuth, METH_VARARGS},
    {"SetMaxAzimuth", RadialResampleAttributes_SetMaxAzimuth, METH_VARARGS},
    {"GetMaxAzimuth", RadialResampleAttributes_GetMaxAzimuth, METH_VARARGS},
    {"SetDeltaAzimuth", RadialResampleAttributes_SetDeltaAzimuth, METH_VARARGS},
    {"GetDeltaAzimuth", RadialResampleAttributes_GetDeltaAzimuth, METH_VARARGS},
    {NULL, NULL}
};

//
// Type functions
//

static void
RadialResampleAttributes_dealloc(PyObject *v)
{
   RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)v;
   if(obj->parent != 0)
       Py_DECREF(obj->parent);
   if(obj->owns)
       delete obj->data;
}

static PyObject *RadialResampleAttributes_richcompare(PyObject *self, PyObject *other, int op);
PyObject *
PyRadialResampleAttributes_getattr(PyObject *self, char *name)
{
    if(strcmp(name, "isFast") == 0)
        return RadialResampleAttributes_GetIsFast(self, NULL);
    if(strcmp(name, "minTheta") == 0)
        return RadialResampleAttributes_GetMinTheta(self, NULL);
    if(strcmp(name, "maxTheta") == 0)
        return RadialResampleAttributes_GetMaxTheta(self, NULL);
    if(strcmp(name, "deltaTheta") == 0)
        return RadialResampleAttributes_GetDeltaTheta(self, NULL);
    if(strcmp(name, "radius") == 0)
        return RadialResampleAttributes_GetRadius(self, NULL);
    if(strcmp(name, "deltaRadius") == 0)
        return RadialResampleAttributes_GetDeltaRadius(self, NULL);
    if(strcmp(name, "center") == 0)
        return RadialResampleAttributes_GetCenter(self, NULL);
    if(strcmp(name, "is3D") == 0)
        return RadialResampleAttributes_GetIs3D(self, NULL);
    if(strcmp(name, "minAzimuth") == 0)
        return RadialResampleAttributes_GetMinAzimuth(self, NULL);
    if(strcmp(name, "maxAzimuth") == 0)
        return RadialResampleAttributes_GetMaxAzimuth(self, NULL);
    if(strcmp(name, "deltaAzimuth") == 0)
        return RadialResampleAttributes_GetDeltaAzimuth(self, NULL);


    // Add a __dict__ answer so that dir() works
    if (!strcmp(name, "__dict__"))
    {
        PyObject *result = PyDict_New();
        for (int i = 0; PyRadialResampleAttributes_methods[i].ml_meth; i++)
            PyDict_SetItem(result,
                PyString_FromString(PyRadialResampleAttributes_methods[i].ml_name),
                PyString_FromString(PyRadialResampleAttributes_methods[i].ml_name));
        return result;
    }

    return Py_FindMethod(PyRadialResampleAttributes_methods, self, name);
}

int
PyRadialResampleAttributes_setattr(PyObject *self, char *name, PyObject *args)
{
    PyObject NULL_PY_OBJ;
    PyObject *obj = &NULL_PY_OBJ;

    if(strcmp(name, "isFast") == 0)
        obj = RadialResampleAttributes_SetIsFast(self, args);
    else if(strcmp(name, "minTheta") == 0)
        obj = RadialResampleAttributes_SetMinTheta(self, args);
    else if(strcmp(name, "maxTheta") == 0)
        obj = RadialResampleAttributes_SetMaxTheta(self, args);
    else if(strcmp(name, "deltaTheta") == 0)
        obj = RadialResampleAttributes_SetDeltaTheta(self, args);
    else if(strcmp(name, "radius") == 0)
        obj = RadialResampleAttributes_SetRadius(self, args);
    else if(strcmp(name, "deltaRadius") == 0)
        obj = RadialResampleAttributes_SetDeltaRadius(self, args);
    else if(strcmp(name, "center") == 0)
        obj = RadialResampleAttributes_SetCenter(self, args);
    else if(strcmp(name, "is3D") == 0)
        obj = RadialResampleAttributes_SetIs3D(self, args);
    else if(strcmp(name, "minAzimuth") == 0)
        obj = RadialResampleAttributes_SetMinAzimuth(self, args);
    else if(strcmp(name, "maxAzimuth") == 0)
        obj = RadialResampleAttributes_SetMaxAzimuth(self, args);
    else if(strcmp(name, "deltaAzimuth") == 0)
        obj = RadialResampleAttributes_SetDeltaAzimuth(self, args);

    if (obj != NULL && obj != &NULL_PY_OBJ)
        Py_DECREF(obj);

    if (obj == &NULL_PY_OBJ)
    {
        obj = NULL;
        PyErr_Format(PyExc_NameError, "name '%s' is not defined", name);
    }
    else if (obj == NULL && !PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "unknown problem with '%s'", name);

    return (obj != NULL) ? 0 : -1;
}

static int
RadialResampleAttributes_print(PyObject *v, FILE *fp, int flags)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)v;
    fprintf(fp, "%s", PyRadialResampleAttributes_ToString(obj->data, "",false).c_str());
    return 0;
}

PyObject *
RadialResampleAttributes_str(PyObject *v)
{
    RadialResampleAttributesObject *obj = (RadialResampleAttributesObject *)v;
    return PyString_FromString(PyRadialResampleAttributes_ToString(obj->data,"", false).c_str());
}

//
// The doc string for the class.
//
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 5)
static const char *RadialResampleAttributes_Purpose = "";
#else
static char *RadialResampleAttributes_Purpose = "";
#endif

//
// Python Type Struct Def Macro from Py2and3Support.h
//
//         VISIT_PY_TYPE_OBJ( VPY_TYPE,
//                            VPY_NAME,
//                            VPY_OBJECT,
//                            VPY_DEALLOC,
//                            VPY_PRINT,
//                            VPY_GETATTR,
//                            VPY_SETATTR,
//                            VPY_STR,
//                            VPY_PURPOSE,
//                            VPY_RICHCOMP,
//                            VPY_AS_NUMBER)

//
// The type description structure
//

VISIT_PY_TYPE_OBJ(RadialResampleAttributesType,         \
                  "RadialResampleAttributes",           \
                  RadialResampleAttributesObject,       \
                  RadialResampleAttributes_dealloc,     \
                  RadialResampleAttributes_print,       \
                  PyRadialResampleAttributes_getattr,   \
                  PyRadialResampleAttributes_setattr,   \
                  RadialResampleAttributes_str,         \
                  RadialResampleAttributes_Purpose,     \
                  RadialResampleAttributes_richcompare, \
                  0); /* as_number*/

//
// Helper function for comparing.
//
static PyObject *
RadialResampleAttributes_richcompare(PyObject *self, PyObject *other, int op)
{
    // only compare against the same type 
    if ( Py_TYPE(self) != &RadialResampleAttributesType
         || Py_TYPE(other) != &RadialResampleAttributesType)
    {
        Py_INCREF(Py_NotImplemented);
        return Py_NotImplemented;
    }

    PyObject *res = NULL;
    RadialResampleAttributes *a = ((RadialResampleAttributesObject *)self)->data;
    RadialResampleAttributes *b = ((RadialResampleAttributesObject *)other)->data;

    switch (op)
    {
       case Py_EQ:
           res = (*a == *b) ? Py_True : Py_False;
           break;
       case Py_NE:
           res = (*a != *b) ? Py_True : Py_False;
           break;
       default:
           res = Py_NotImplemented;
           break;
    }

    Py_INCREF(res);
    return res;
}

//
// Helper functions for object allocation.
//

static RadialResampleAttributes *defaultAtts = 0;
static RadialResampleAttributes *currentAtts = 0;

static PyObject *
NewRadialResampleAttributes(int useCurrent)
{
    RadialResampleAttributesObject *newObject;
    newObject = PyObject_NEW(RadialResampleAttributesObject, &RadialResampleAttributesType);
    if(newObject == NULL)
        return NULL;
    if(useCurrent && currentAtts != 0)
        newObject->data = new RadialResampleAttributes(*currentAtts);
    else if(defaultAtts != 0)
        newObject->data = new RadialResampleAttributes(*defaultAtts);
    else
        newObject->data = new RadialResampleAttributes;
    newObject->owns = true;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

static PyObject *
WrapRadialResampleAttributes(const RadialResampleAttributes *attr)
{
    RadialResampleAttributesObject *newObject;
    newObject = PyObject_NEW(RadialResampleAttributesObject, &RadialResampleAttributesType);
    if(newObject == NULL)
        return NULL;
    newObject->data = (RadialResampleAttributes *)attr;
    newObject->owns = false;
    newObject->parent = 0;
    return (PyObject *)newObject;
}

///////////////////////////////////////////////////////////////////////////////
//
// Interface that is exposed to the VisIt module.
//
///////////////////////////////////////////////////////////////////////////////

PyObject *
RadialResampleAttributes_new(PyObject *self, PyObject *args)
{
    int useCurrent = 0;
    if (!PyArg_ParseTuple(args, "i", &useCurrent))
    {
        if (!PyArg_ParseTuple(args, ""))
            return NULL;
        else
            PyErr_Clear();
    }

    return (PyObject *)NewRadialResampleAttributes(useCurrent);
}

//
// Plugin method table. These methods are added to the visitmodule's methods.
//
static PyMethodDef RadialResampleAttributesMethods[] = {
    {"RadialResampleAttributes", RadialResampleAttributes_new, METH_VARARGS},
    {NULL,      NULL}        /* Sentinel */
};

static Observer *RadialResampleAttributesObserver = 0;

std::string
PyRadialResampleAttributes_GetLogString()
{
    std::string s("RadialResampleAtts = RadialResampleAttributes()\n");
    if(currentAtts != 0)
        s += PyRadialResampleAttributes_ToString(currentAtts, "RadialResampleAtts.", true);
    return s;
}

static void
PyRadialResampleAttributes_CallLogRoutine(Subject *subj, void *data)
{
    typedef void (*logCallback)(const std::string &);
    logCallback cb = (logCallback)data;

    if(cb != 0)
    {
        std::string s("RadialResampleAtts = RadialResampleAttributes()\n");
        s += PyRadialResampleAttributes_ToString(currentAtts, "RadialResampleAtts.", true);
        cb(s);
    }
}

void
PyRadialResampleAttributes_StartUp(RadialResampleAttributes *subj, void *data)
{
    if(subj == 0)
        return;

    currentAtts = subj;
    PyRadialResampleAttributes_SetDefaults(subj);

    //
    // Create the observer that will be notified when the attributes change.
    //
    if(RadialResampleAttributesObserver == 0)
    {
        RadialResampleAttributesObserver = new ObserverToCallback(subj,
            PyRadialResampleAttributes_CallLogRoutine, (void *)data);
    }

}

void
PyRadialResampleAttributes_CloseDown()
{
    delete defaultAtts;
    defaultAtts = 0;
    delete RadialResampleAttributesObserver;
    RadialResampleAttributesObserver = 0;
}

PyMethodDef *
PyRadialResampleAttributes_GetMethodTable(int *nMethods)
{
    *nMethods = 1;
    return RadialResampleAttributesMethods;
}

bool
PyRadialResampleAttributes_Check(PyObject *obj)
{
    return (obj->ob_type == &RadialResampleAttributesType);
}

RadialResampleAttributes *
PyRadialResampleAttributes_FromPyObject(PyObject *obj)
{
    RadialResampleAttributesObject *obj2 = (RadialResampleAttributesObject *)obj;
    return obj2->data;
}

PyObject *
PyRadialResampleAttributes_New()
{
    return NewRadialResampleAttributes(0);
}

PyObject *
PyRadialResampleAttributes_Wrap(const RadialResampleAttributes *attr)
{
    return WrapRadialResampleAttributes(attr);
}

void
PyRadialResampleAttributes_SetParent(PyObject *obj, PyObject *parent)
{
    RadialResampleAttributesObject *obj2 = (RadialResampleAttributesObject *)obj;
    obj2->parent = parent;
}

void
PyRadialResampleAttributes_SetDefaults(const RadialResampleAttributes *atts)
{
    if(defaultAtts)
        delete defaultAtts;

    defaultAtts = new RadialResampleAttributes(*atts);
}

